package com.luke.bio;

import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;

/**
 * @Descrtption BioClient
 * @Author luke
 * @Date 2020/4/22
 **/
public class BioClient {

    public static void main(String[] args){
        int port = 8762;
        try {
            Socket socket = new Socket("127.0.0.1",port);
            PrintWriter printWriter = new PrintWriter(socket.getOutputStream(), true);
            while(true){
                byte[] data = new byte[1024];
                int readLen = System.in.read(data);
                String message = new String(data,0,readLen - 1); //读取控制台输入的数据
                if("exit".equals(message)){//退出应用
                    break;
                }else {
                    printWriter.println(message);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
        }
    }

}
